/*
 * @Author: chen haoxuan
 * @Date: 2021-05-10 22:01:57
 * @LastEditTime: 2021-05-10 22:14:29
 */
#include<iostream>
using namespace std;
class Student
{
    public:
        Student(int n,int s);
        void display();
    private:
        int number;
        int score;
};
Student::Student(int n,int s):number(n),score(s){}
void Student::display()
{
    cout<<number<<" "<<score<<endl;
}
int main()
{
   Student stud[5]={
       Student(1001,89),
       Student(1002,90),
       Student(1003,91),
       Student(1004,92),
       Student(1005,93)
   };
   Student *p=stud;
   stud[0].display();   //指针从0开始 指针从0开始 指针从0开始
   stud[2].display();
   stud[4].display();
   system("pause");
}